package cn.com.web.Servlet;

import cn.com.service.OrderService;
import cn.com.service.impl.OrderServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/RuzhuServlet")
public class RuzhuServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String ouid = request.getParameter("ouid");
        String ischeck = request.getParameter("ischeck");
        OrderService orderService=new OrderServiceImpl();
        //改变是否入住字段
        orderService.changIsChecked(ouid,ischeck);
        //请求转发到ShowCustomerServlet
        request.getRequestDispatcher("FindOrderByPageServlet?currentPage=1&rows=5")
                .forward(request,response);

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }
}
